﻿using System;
using System.Collections.Generic;
using System.Text;
using Sinacor.Infra.Service.Validation;
using Sinacor.Infra.Service.Common;

namespace Sinacor.Service.Infra.AuthorizationService.BusinessEntity
{
    /// <summary>
    /// Entidade de negocio BehaviorPolicy
    /// </summary>
    public class BehaviorPolicy : BaseBusinessEntity
    {
        #region Campos

        /// <summary>
        /// Campo _companyId
        /// </summary>
        private System.Int32? _companyId;

        /// <summary>
        /// Campo _roleId
        /// </summary>
        private System.String _roleId;

        ///// <summary>
        ///// Campo _associatedPolicy
        ///// </summary>
        private Policy _associatedPolicy;

        /// <summary>
        /// Campo _isEditable
        /// </summary>
        private System.Boolean? _isEditable;

        /// <summary>
        /// Campo _isVisible
        /// </summary>
        private System.Boolean? _isVisible;

        #endregion

        #region Propriedades

        [NotNull(0, RuleSetConstants.INSERT)]
        [NotNull(0, RuleSetConstants.UPDATE)]
        [NotNull(0, RuleSetConstants.DELETE)]
        [NotNull(0, RuleSetConstants.SELECTONE)]
        [NotNull(0, RuleSetConstants.SELECTMANY)]
        public System.Int32? CompanyId
        {
            get { return _companyId; }
            set { _companyId = value; }
        }

        /// <summary>
        /// Propriedade RoleId
        /// </summary>
        [NotNull(902,RuleSetConstants.INSERT)]
        [NotEmpty(903, RuleSetConstants.INSERT, true)]
        [NotNull(904, RuleSetConstants.UPDATE)]
        [NotEmpty(905, RuleSetConstants.UPDATE, true)]
        [NotNull(906, RuleSetConstants.DELETE)]
        [NotEmpty(907, RuleSetConstants.DELETE, true)]
        [NotNull(908, RuleSetConstants.SELECTONE)]
        [NotEmpty(909, RuleSetConstants.SELECTONE, true)]
        public System.String RoleId
        {
            get { return this._roleId; }
            set { this._roleId = value; }
        }

        [NotNull(910, RuleSetConstants.INSERT)]
        [NotNull(911, RuleSetConstants.UPDATE)]
        [NotNull(912, RuleSetConstants.DELETE)]
        [NotNull(913, RuleSetConstants.SELECTONE)]
        public Policy AssociatedPolicy
        {
            get { return _associatedPolicy; }
            set { _associatedPolicy = value; }
        }

        /// <summary>
        /// Propriedade IsEditable
        /// </summary>
        [NotNull(914, RuleSetConstants.INSERT)]
        [NotNull(915, RuleSetConstants.UPDATE)]
        public System.Boolean? IsEditable
        {
            get { return this._isEditable; }
            set { this._isEditable = value; }
        }

        /// <summary>
        /// Propriedade IsVisible
        /// </summary>
        [NotNull(916, RuleSetConstants.INSERT)]
        [NotNull(917, RuleSetConstants.UPDATE)]
        public System.Boolean? IsVisible
        {
            get { return this._isVisible; }
            set { this._isVisible = value; }
        }

        #endregion

        #region Construtores

        /// <summary>
        /// Construtor BehaviorPolicy
        /// </summary>
        public BehaviorPolicy()
        {
            _associatedPolicy = new Policy();
        }

        #endregion
    }
}

